import React from 'react';

import { SearchDataResponseItemType } from '@/types/dataset/type';

import { QuoteItem } from './QuoteItem';

export const QuoteList = React.memo(function QuoteList({
  rawSearch = [],
  showDetail,
}: {
  rawSearch: SearchDataResponseItemType[];
  showDetail: boolean;
}) {
  return (
    <div className="flex max-h-[300px] flex-col gap-2 overflow-y-auto">
      {rawSearch.map((item, i) => (
        <div key={i}>
          <QuoteItem quoteItem={item} canViewSource={showDetail} linkToDataset={showDetail} />
        </div>
      ))}
    </div>
  );
});
